<script src="/vendor/laravel-admin/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="/vendor/laravel-admin/AdminLTE/bootstrap/js/bootstrap.min.js"></script>
<script src="/vendor/jquery/layer/layer.js"></script>
<script src="/vendor/laravel-admin/moment/min/moment-with-locales.min.js"></script>
<script src="/vendor/laravel-admin/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="/vendor/laravel-admin/AdminLTE/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/vendor/laravel-admin/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">
<style>
    .img-list {
        width: 200px;
        height: 200px;
        padding: 5px;
    }
    .work-list {
        width: 100px;
        height: 100px;
        padding: 5px;
    }
</style>
<div class="container-fluid margin-top-large">
    <table class="table container">
        <thead>
            <tr>
                <th width="25%">基本信息</th>
                <th width="30%">认证信息</th>
                <th>认证图片</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <p>用户uid：{{$data['uid']}}</p>
                    <p>用户昵称：{{$data['nick']}}</p>
                    <p>对接销售：{{$data['sale_bind']}} </p>
                    <p>对接运营：{{$data['operator_bind']}} </p>
                    <p>注册日期：{{$data['register_time']}}</p>
                    <p>申请日期：{{$data['apply_time']}}</p>
                    <p>认证身份：<b>{{$data['designer_type_text']}}</b></p>
                    <p>认证状态：{{$data['auth_status']}}</p>
                    @if($data['auth_status']=='已认证')
                        <p>认证到期时间：{{$data['expire_time']}}
                            @if($data['punish_txt']!='')
                            <span style="color: red">({{$data['punish_txt']}})</span>
                            @endif
                        </p>
                    @endif
                    <p>首次申请认证时间：{{$data['create_time']}}</p>
                    <p>最近一次提交时间：{{$data['update_time']}}</p>
                    <p>案例审核状态：{{$data['house_article_audit_status_text']}}</p>
                    <p>资料审核状态：{{$data['identity_info_audit_status_text']}}</p>
                    <div @if($data['designer_type'] == 2)>
                        <hr style="border-color: #c0c0c0">
                        <p>认证套餐：{{$data['package_name']}}</p>
                        <p>KA服务：{{$data['ka']}}</p>
                        <p>在职账号上限（可绑定机构在职账号数量上限）：{{$data['max_bind']}}</p>
                        <p>已绑定在职账号数：{{$data['has_bind']}}</p>
                    </div @endif>
                </td>
                <td>
                    @if($data['designer_type'] == 2)
                        <p>运营人员姓名：{{$data['operator_name']}}</p>
                        <p>所在城市：{{$data['now_area']}}</p>
                        <p>手机号：{{$data['phone']}}</p>
                        <p>微信：{{$data['wechat']}}</p>
                        <p>微信公众号：{{$data['wechat_public']}}</p>
                        <p>微博：{{$data['weibo']}}</p>
                        <p>工作岗位：{{$data['job']}}</p>
                        <p>入行年份：{{$data['into_year']}}</p>
                        <p>最高学历：{{$data['education']}}</p>
                        <p>所学专业：{{$data['major']}}</p>
                        <p>最高学历院校：{{$data['top_school']}}</p>
                        <p>企业名称：{{$data['enterprise_name']}}
                            <label @if($data['repeat'])>
                                <b style="color: red">「重复昵称，与uid：{{$data['repeat_user']}} 共用同一昵称」</b>
                            </label @endif>
                        </p>
                        <p>公司成立年份：{{$data['establish_year']}}</p>
                        <p>设计团队规模：{{$data['team_size']}}</p>
                        <p>家装私宅项目平均的平米造价大概是多少：半包（{{$data['half_pack_price']}}元/㎡） 全包（{{$data['full_pack_price']}}元/㎡） 全案（{{$data['whole_case_price']}}元/㎡）</p>
                        <p>有长期合作或者自己的施工队吗：{{$data['is_crew']}}</p>
                        <p>每年做多少家装项目：{{$data['private_job']}}</p>
                        <p>擅长的设计方向：{{$data['good_at_direction']}}</p>
                        <p>擅长的设计风格：{{$data['good_at_style']}}</p>
                        <p>从哪儿知道好好住APP，并下载使用的：{{$data['where_know']}}</p>
                        <p>推荐人名字：{{$data['presenter']}}</p>
                        <p>身份证号：{{$data['id_card_number']}}</p>
                        <p>营业执照注册号：{{$data['business_license_number']}}</p>
                        <p>营业执照注册日期：{{$data['founded_date']}}</p>
                        <p>机构服务范围：{{$data['service_scope']}}</p>
                        <p>通常以什么价格成交（元/平米）：{{$data['general_price']}}</p>
                        <hr style="border-color: #c0c0c0">
                        <p><b>是否在列表黑名单：</b>{{$data['is_in_black']}}</p>
                        <p><b>热图数量：</b>{{$data['hot_photo']}}</p>
                        <p><b>服务价格（元/平米）：</b>{{$data['service_price']}}</p>
                    @else
                        <p>真实姓名：{{$data['real_name']}}</p>
                        <p>所在城市：{{$data['now_area']}}</p>
                        @if($data['designer_type'] == 3 || $data['designer_type'] == 4)
                            <p>所在公司名称：{{$data['company_name']}}</p>
                        @endif
                        <p>手机号：{{$data['phone']}}</p>
                        <p>微信：{{$data['wechat']}}</p>
                        <p>微信公众号：{{$data['wechat_public']}}</p>
                        <p>微博：{{$data['weibo']}}</p>
                        <p>工作岗位：{{$data['job']}}</p>
                        <p>入行年份：{{$data['into_year']}}</p>
                        <p>最高学历：{{$data['education']}}</p>
                        <p>所学专业：{{$data['major']}}</p>
                        <p>最高学历院校：{{$data['top_school']}}</p>
                        <p>是否在设计公司或装饰公司工作过：{{$data['is_work_design']}}</p>
                        <p>公司成立年份：{{$data['establish_year']}}</p>
                        <p>设计团队规模：{{$data['team_size']}}</p>
                        <p>家装私宅项目平均的平米造价大概是多少：半包（{{$data['half_pack_price']}}元/㎡） 全包（{{$data['full_pack_price']}}元/㎡） 全案（{{$data['whole_case_price']}}元/㎡）</p>
                        <p>有长期合作或者自己的施工队吗：{{$data['is_crew']}}</p>
                        <p>每年做多少家装项目：{{$data['private_job']}}</p>
                        <p>擅长的设计方向：{{$data['good_at_direction']}}</p>
                        <p>擅长的设计风格：{{$data['good_at_style']}}</p>
                        <p>从哪儿知道好好住APP，并下载使用的：{{$data['where_know']}}</p>
                        <p>推荐人名字：{{$data['presenter']}}</p>
                        <p>身份证号：{{$data['id_card_number']}}</p>
                        <p>营业执照注册号：{{$data['business_license_number']}}</p>
                        <p>营业执照注册日期：{{$data['founded_date']}}</p>
                        <p>机构服务范围：{{$data['service_scope']}}</p>
                        <p>目前是否在装修公司/设计公司任职：{{$data['is_employee']}}</p>
                        <p>通常以什么价格成交（元/平米）：{{$data['general_price']}}</p>
                        <hr style="border-color: #c0c0c0">
                        <p><b>是否在列表黑名单：</b>{{$data['is_in_black']}}</p>
                        <p><b>热图数量：</b>{{$data['hot_photo']}}</p>
                        <p><b>服务价格（元/平米）：</b>{{$data['service_price']}}</p>
                    @endif
                </td>
                <td>
                    <form class="form-horizontal">
                        <div class="form-group" @if($data['designer_type'] == 2)>
                            <h5>手持身份证照片：</h5>
                            <a href="{{$data['hand_card_pic']}}" target="_blank"><img class="img-list" src="{{$data['hand_card_pic_thumbnail']}}"></a>
                            <h5>企业工商营业执照：</h5>
                            <a href="{{$data['business_license_pic']}}" target="_blank"><img class="img-list" src="{{$data['business_license_pic_thumbnail']}}"></a>
                            <h5>公函：</h5>
                            <a href="{{$data['missive']}}" target="_blank"><img class="img-list" src="{{$data['missive_thumbnail']}}"></a>
                        </div>
                        @else
                            <div class="form-group">
                                <h5>手持身份证照片：</h5>
                                <a href="{{$data['hand_card_pic']}}" target="_blank"><img class="img-list" src="{{$data['hand_card_pic_thumbnail']}}"></a>
                                <h5>身份证正面照片：</h5>
                                <a href="{{$data['front_card_pic']}}" target="_blank"><img class="img-list" src="{{$data['front_card_pic_thumbnail']}}"></a>
                                <h5>身份证反面照片：</h5>
                                <a href="{{$data['reverse_card_pic']}}" target="_blank"><img class="img-list" src="{{$data['reverse_card_pic_thumbnail']}}"></a>
                                <h5>公函：</h5>
                                <a href="{{$data['missive']}}" target="_blank"><img class="img-list" src="{{$data['missive_thumbnail']}}"></a>
                            </div>
                        @endif
                        <div class="form-group">
                            <hr style="border-color: #c0c0c0">
                            <h5>整屋数量：<a target="_blank" href="/admin/article/select/index?&uid=&uid={{$data['uid']}}">{{$article_num}}</a></h5>
                            <h5>其他平台作品链接：</h5>
                            @foreach($other_works as $key => $vo)
                                <p style="word-break:break-all;">作品{{$key + 1}}：<a href="{{$vo}}" target="_blank">{{$vo}}</a></p>
                            @endforeach
                            <h5>实景作品：</h5>
                            @foreach($real_works as $vo)
                                <p class="lead">{{$vo['name']}}</p>
                                @foreach($vo['images'] as $pic)
                                    <a target="_blank" href="{{$pic['big_image']}}"><img alt="实景图" class="work-list" src="{{$pic['thumbnail']}}"></a>
                                @endforeach
                                @if($vo['checkSame'])
                                    <div style="color:red">疑似重复案例</div>
                                    @if($vo['checkSame']['status'])
                                        @if($vo['checkSame']['result'])
                                            @foreach($vo['checkSame']['result'] as $aid => $item)
                                                <div>
                                                    <span>案例id: <a href="https://frieza.haohaozhu.me/admin/article/select/audit/{{$aid}}" target='_blank' >{{$aid}}</a>  </span>
                                                    <span>  重复占比: {{count($item)}}/{{$vo['checkSame']['totalNum']}}</span>
                                                </div>
                                            @endforeach
                                        @else
                                            <div>无</div>
                                        @endif
                                    @else
                                        <div>处理中</div>
                                    @endif
                                @endif
                            @endforeach
                        </div>
                    </form>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="table-responsive">
        <table class="table">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>DSN</th>
                    <th>UID</th>
                    <th>套餐id</th>
                    <th>套餐名称</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>服务类别</th>
                    <th>服务状态</th>
                </tr>
            </thead>
            @foreach($services as $vo)
                <tr>
                    <td>{{$vo['id']}}</td>
                    <td>{{$vo['dsn']}}</td>
                    <td>{{$vo['uid']}}</td>
                    <td>{{$vo['package_id']}}</td>
                    <td>{{$vo['package_name']}}</td>
                    <td>{{$vo['start_time']}}</td>
                    <td>{{$vo['end_time']}}</td>
                    <td>{{$vo['service_type_text']}}</td>
                    <td>{{$vo['status_text']}}</td>
                </tr>
            @endforeach
        </table>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $(".submit").click(function (e) {
            let uid = $(":input[name='uid']").val();
            let reason = $(":input[name='reason']").val();

            if (reason === '') {
                parent.layer.msg('请填写取消认证的原因');
                return false;
            }
            let url = "{{url('/admin/DesignerAuth/cancel_auth/submit')}}";

            $.post(url, {
                uid: uid,
                reason: reason
            }, function (result) {
                if (result.code === 1) {
                    parent.layer.msg(result.msg);
                    timeOut();
                } else {
                    parent.layer.msg(result.msg);
                }
            });

            return false;
        });

        $(".cancel").click(function (e) {
            let index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });

        function timeOut() {
            setTimeout(function () {
                parent.window.location.reload();
            }, 200);
        }
    });
</script>
